<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-frontend',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'frontend\controllers',
    'timeZone' => 'Asia/Shanghai',
    'modules' => [
        'doconline' => [
            'class' => 'Kaopur\yii2_doc_online\Module',
            'defaultRoute' => 'index', //默认控制器
            'appControllers' => true, //是否检测app\controllers命名空间下的控制器
            'suffix' => '', //后缀
            'prefix' => '', //前缀
            'modules' => [  //需要生成文档的模块命名空间
                'frontend\modules\site\Module',
            ]
        ],
        'orders' => [
            'class' => 'frontend\modules\orders\Module'
        ],
        'wxad' => [
            'class' => 'frontend\modules\wxad\Module'
        ],
        'goods' => [
            'class' => 'frontend\modules\goods\Module'
        ],
        'site' => [
            'class' => 'frontend\modules\site\Module'
        ],
        'cart' => [
            'class' => 'frontend\modules\cart\Module'
        ],
        'address' => [
            'class' => 'frontend\modules\address\Module'
        ],
        'comment' => [
            'class' => 'frontend\modules\comment\Module'
        ],
        'marketing' => [
            'class' => 'frontend\modules\marketing\Module'
        ],
    ],
    'components' => [
        'request' => [
            'csrfParam' => '_csrf',
        ],
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
            'identityCookie' => ['name' => '_identity-frontend', 'httpOnly' => true],
        ],
        'session' => [
            // this is the name of the session cookie used for login on the frontend
            'name' => 'advanced-frontend',
        ],
        'UserInfo'=>[
            'class'=>'frontend\comp\UserInfo',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        /*
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
            ],
        ],
        */
    ],
    'params' => $params,
];
